package com.youyi.yypermissionlibrary.core;

import android.content.Context;

public final class Acp {
    private AcpManager mAcpManager;
    private volatile boolean mInitialized;

    public static Acp getInstance(Context context) {
        Acp acp = HolderClass.instance;
        acp.init(context);
        return acp;
    }

    public void request(AcpOptions acpOptions, AcpListener acpListener) {
        this.mAcpManager.request(acpOptions, acpListener);
    }

    public void onDestroy() {
        this.mAcpManager.onDestroy();
    }

    /* access modifiers changed from: package-private */
    public AcpManager getAcpManager() {
        return this.mAcpManager;
    }

    private void init(Context context) {
        if (!this.mInitialized) {
            this.mAcpManager = new AcpManager(context.getApplicationContext());
            this.mInitialized = true;
        }
    }

    /* access modifiers changed from: private */
    public static class HolderClass {
        private static final Acp instance = new Acp();

        private HolderClass() {
        }
    }
}
